package com.sname.demozuul;

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.zuul.filters.discovery.PatternServiceRouteMapper;
import org.springframework.context.annotation.Bean;

@SpringCloudApplication
public class DemoZuulApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoZuulApplication.class, args);
    }

//    /** 自定义过滤器,注入spring */
//    @Bean
//    public TokenFilter tokenFilter() {
//        return new TokenFilter();
//    }

    /** 自定义决定路由的类 */
    @Bean
    public PatternServiceRouteMapper serviceRouteMapper() {
        /**规则映射*/
        /** 1参是服务列表路径,2参路由路径 **/
        /** 此处是服务规则,ignored-patterns是路径 **/
        return new PatternServiceRouteMapper("", "");
    }
}
